package com.example.warehousems.dao.model;

import com.example.warehousems.config.Constants;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Entity
@Table(name = "job_ticket")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class JobTicket {
    @Id
    @GeneratedValue
    private Integer id;
    @ManyToOne
    @JoinColumn(name = "proposer")
    private User proposer;
    private String contactName;
    private String phoneNum;
    @OneToMany(mappedBy = "jobTicket")
    @JsonManagedReference
    private List<Cargo> cargoList;
    private Float price;
    private LocalDateTime createTime;
    private LocalDateTime estimateTime;
    @ManyToOne
    @JoinColumn(name = "admin")
    private User admin;
    private String adminSug;
    // 0-等待管理员审核 1-审核完成，待支付 2-支付完成，待最终确认，正在入库 3-入库完成，正常存储 -1-工单报废
//    private Integer status;
    private Constants.JOBTICKETSTATUS status;
}
